<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/commons/pages/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>优选等级分类管理</title>
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/${themes}/easyui.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../styles/demo.css">
<script type="text/javascript" src="../jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../scripts/public.js.jsp"></script>
<script type="text/javascript" src="${ctx}/platform/type-info/format"></script>
</head>
<body>
<!--div class="demo-info">
  <div class="demo-tip icon-tip"></div>
  <div>优选等级分类管理</div>
</div-->
<c:if test="${fn:containsIgnoreCase(action_codes, 'S')}">
  <div style="padding:5px; margin-bottom:5px; display:block;" class="combo">
    <form method="post" id="fm_search" novalidate>
      编码：
      <input class="easyui-validatebox" style="width:80px;" id="type_code" name="type_code" />
      名称：
      <input class="easyui-validatebox" style="width:80px;" id="type_name" name="type_name" />
      锁定：
      <select id="is_lock" name="is_lock" style="width:50px;">
      </select>
      删除：
      <select id="is_del" name="is_del" style="width:50px;">
      </select>
      <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="doSearch();">搜索</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="$('#fm_search').form('clear');">重置</a>
    </form>
  </div>
</c:if>
<div id="dg"> </div>
<div id="dlg" class="easyui-dialog" data-options="closed:true, modal:true, buttons:'#dlg-buttons'" style="width:400px; height:280px; padding:10px 40px">
  <form method="post" id="fm" novalidate>
    <input name="id" type="hidden" id="id" />
    <table>
      <tr>
        <td align="right"><b>编码：</b></td>
        <td><input id="type_code" name="type_code" style="width:200px;" type="text" class="easyui-validatebox" data-options="required:true" /></td>
      </tr>
      <tr>
        <td align="right"><b>名称：</b></td>
        <td><input id="type_name" name="type_name" style="width:200px;" type="text" class="easyui-validatebox" data-options="required:true" /></td>
      </tr>
      <tr>
        <td align="right"><b>说明：</b></td>
        <td><input id="type_desc" name="type_desc" style="width:200px;" type="text" /></td>
      </tr>
      <tr>
        <td align="right"><b>排序值：</b></td>
        <td><input id="order_value" name="order_value" style="width:80px;" class="easyui-numberspinner" min="0" max="9999" value="0" /></td>
      </tr>
      <tr>
        <td align="right"><b>锁定：</b></td>
        <td><select id="is_lock" name="is_lock" style="width:80px;" class="easyui-validatebox" data-options="required:true">
          </select></td>
      </tr>
      <tr>
        <td align="right"><b>删除：</b></td>
        <td><select id="is_del" name="is_del" style="width:80px;" class="easyui-validatebox" data-options="required:true">
          </select></td>
      </tr>
    </table>
  </form>
</div>
<div id="dlg-buttons"> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="doSave();">保存</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="$('#dlg').dialog('close');">关闭</a> </div>
<script type="text/javascript">
$(function(){
	//初始化列表
	$('#dg').datagrid({  
	    url:'${ctx}/platform/type-sel-level/search',
		queryParams:$('#fm_search').serializeObject(),
	    frozenColumns:[[
	    	{field:'ck',checkbox:true}
	 	]],
	    columns:[[
			{field:'id',title:'id',hidden:true},   
	        {field:'type_code',title:'编码'/*,width:60*/,sortable:true},
	        {field:'type_name',title:'名称'/*,width:160*/},
			{field:'type_desc',title:'说明'/*,width:200*/},
			{field:'order_value',title:'排序值'/*,width:50*/,align:'right'},
			{field:'is_lock',title:'锁定'/*,width:40*/,align:'center',formatter:formatBoolean,styler:styleBoolean},
			{field:'is_del',title:'删除'/*,width:40*/,align:'center',formatter:formatBoolean,styler:styleBoolean}
	    ]],
		//fitColumns:true,
		striped:true,
		pagination:true,
		remoteSort:false,
		rownumbers:true,
		singleSelect:false,
		toolbar:[
			//<c:if test="${fn:containsIgnoreCase(action_codes, 'D')}">
			{
				id:'btnRemove',
				text:'删除',
				iconCls:'icon-remove',
				handler:function(){doRemove();}
			},'-',
			//</c:if>
			//<c:if test="${fn:containsIgnoreCase(action_codes, 'C')}">
			{
				id:'btnAdd',
				text:'添加',
				iconCls:'icon-add',
				handler:function(){doAdd();}
			},
			//</c:if>
			//<c:if test="${fn:containsIgnoreCase(action_codes, 'U')}">
			{
				id:'btnEdit',
				text:'修改',
				iconCls:'icon-edit',
				handler:function(){doEdit();}
			},
			//</c:if>{}
		] 
	});  
});
</script>
</body>
</html>